package main

import "fmt"

type Animal interface {
	speak()
}

type Cat struct {
	name string
	age int
}

func (cat Cat)speak() {
	fmt.Printf("我是%s,我今年%d岁了\n", cat.name, cat.age)
	fmt.Println("喵喵喵~~~")
}

type Dog struct {
	name string
	age int
}

func (dog *Dog)speak() {
	fmt.Printf("我是%s,我今年%d岁了\n", dog.name, dog.age)
	fmt.Println("汪汪汪~~~")
}

// func main() {
// 	c := Cat{name: "gaffe", age: 3}
// 	c.speak()
// 	d := &Dog{name: "mike", age: 8}
// 	d.speak()
// }